<%@ page contentType="text/html; charset=UTF-8"%><!DOCTYPE HTML>
<%String $root=request.getContextPath(); %>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>通用上传组件</title>


<link rel="stylesheet" href="${ctx}/static/admin/plupload/css/jquery-ui.min.css" type="text/css" />
<link rel="stylesheet" href="${ctx}/static/admin/plupload/css/jquery.ui.plupload.css" type="text/css" />

<script type="text/javascript" src="${ctx}/static/admin/easyui/jquery.min.js"></script>
<script type="text/javascript" src="${ctx}/static/admin/plupload/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="${ctx}/static/admin/plupload/js/plupload.full.min.js"></script>
<script type="text/javascript" src="${ctx}/static/admin/plupload/js/jquery.ui.plupload.min.js"></script>
<script type="text/javascript" src="${ctx}/static/admin/plupload/js/zh_CN.js"></script>
<style type="text/css">
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {line-height: 20px;}
</style>
<script type="text/javascript">

$(function() {
	var options = top.$window?top.$window.options(window):null;
	if(!options) options = {};
	var uploaded = options.uploaded;
	var complete = options.complete;
	options = $.extend({runtimes:'html5,flash,silverlight,html4',url:'/file/upload',max_file_count:20,filters:{max_file_size:'200mb'},rename:true,sortable:true,dragdrop:true,flash_swf_url:'/js/plupload/Moxie.swf',silverlight_xap_url:'/js/plupload/Moxie.xap',views:{list: true,thumbs: true,active: 'thumbs'}
	},options,true);
	options.uploaded = function() {
		if(typeof uploaded == 'function') {
			//var files=$('#uploader').plupload('getFiles');
			uploaded.call($('#uploader').plupload('getFiles'));
		}
	};
	options.complete = function() {
		if(typeof complete == 'function') {
			//var files=$('#uploader').plupload('getFiles');
			complete.call($('#uploader').plupload('getFiles'));
			top.$window.close(window,1);
		}
	};
	options.preinit = {
			UploadFile:function(up, file) {
				up.setOption('multipart_params', {id :file.id});
				//up.setOption('multipart_params', {name :file.id});
			}
	};
	$("#uploader").plupload(options);
});
</script>
</head>
<body>
<div id="uploader">
	<p>您的浏览器不支持上传组件</p>
</div>
</body>
</html>
